package com.xxx.yuedong.course.controller.form;


import io.swagger.annotations.ApiModelProperty;

import lombok.Data;


import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;


/**
 * 新增课程参数类
 *
 * @Author YinXi
 * @Versin 1.0.0
 * @Date 2023/8/11
 */
@Data
public class AddCourseForm {
    /**
     * 课程名称
     */
    @NotBlank(message = "课程名称不能为空")
    @Pattern(regexp = "^[a-z0-9A-Z\\u4e00-\\u9fa5]{2,30}$",
            message = "课程名称必须是2~30个字符组成，并且字符只能是中文，英文和数字")
    @ApiModelProperty(value = "课程名称",required = true)
    private String name;
    /**
     * 课程描述
     */
    @NotBlank(message="课程描述不能为空")
    @Pattern(regexp = "^[\\s\\S]{0,200}$",
            message = "课程描述在200字以内")
    @ApiModelProperty(value = "课程描述",required = true)
    private String desc;
    /**
     * 课程封面
     */
    @NotBlank(message="课程封面不能为空")
    @ApiModelProperty(value = "课程URL地址",required = true)
    private String cover;
    /**
     * 视频地址
     */
    @NotBlank(message="视频地址不能为空")
    @ApiModelProperty(value = "视频URL地址",required = true)
    private String url;
    /**
     * 视频标签
     */
    @NotNull(message="视频标签不能为空")
    @ApiModelProperty(value = "视频标签",required = true)
    private String tags;
    /**
     * 卡路里
     */
    @NotNull(message="卡路里不能为空")
    @ApiModelProperty(value = "卡路里",required = true)
    private Integer calorie;
}
